<?php

include '../../db.php';
$connect = pg_connect($connectionString);
if (!$connect) {
    echo "connect : A connection to the server could not be established!";
    return false;
}

$params = array();
array_push($params, pg_escape_string($_GET["id"]));
$stmt = pg_prepare($connect, "read_config_user", "SELECT id, name,password,type_id FROM config_user WHERE id = $1;");
$result = pg_execute($connect, "read_config_user", $params);

if (!$result) {
    die("Error in SQL query: " . pg_last_error());
}
$arrRegistros = pg_fetch_all($result);
echo json_encode($arrRegistros);
pg_free_result($result);
pg_close($connect);


